<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h2>generator异步方案</h2>
</body>
<script>
    function *gen() {
        yield 666;
        yield 888;
        yield 999;

        return 'ok'

    }

    let g=gen()

    // console.log(g.next().value)
    // console.log(g.next().value)

</script>
</html>